//
//  YNUserGroup.h
//  Messenger
//
//  Created by OC on 15/1/19.
//  Copyright (c) 2015年 李健. All rights reserved.
//
//  群/讨论组实体类 groupType:1 群  groupType:2 讨论组
//

#import <Foundation/Foundation.h>
#import "YNIMFrameworkTypedef.h"

@interface YNContactGroup : NSObject

//gruoupName群ID
@property (nonatomic, strong) NSString *groupName;
//群组类型
@property(nonatomic,assign)CurrenChatObjType groupType;
//createUser创建者
@property (nonatomic, strong) NSString *createUser;

//createTime创建时间
@property (nonatomic, strong) NSString *createTime;

//naturalName群名称
@property (nonatomic, strong) NSString *naturalName;

//subjectPC群会话窗口顶部标题下方的描述
@property (nonatomic, strong) NSString *subject;

//maxUsers最大成员数
@property (nonatomic) int maxUsers;

//desc群公告（描述简介）
@property (nonatomic, strong) NSString *desc;

//userCount群或讨论组下面成员
@property (nonatomic, strong) NSArray *memberArray;
/**
 *  2018-11-8jc添加
 *  在线人数
 */
@property(nonatomic,assign)NSInteger onlineCount;


/**
 *  2017-5-26jc添加，增加role(群，讨论组)标示
 */
@property(nonatomic,strong)NSString * role;
/**
 * 2018-6-7jc添加，直播会议聊天需要传这个值
 会议meetingId
 */
@property(nonatomic,strong)NSString * mettingId;

//创建群或讨论组表
+ (BOOL)createDatabase:(FMDatabase *)db;

//插入群或讨论组
- (BOOL)insertGroupDatabase:(FMDatabase *)db;

//根据groupName删除数据
- (BOOL)deleteWithGroupDatabase:(FMDatabase *)db;

//删除表中所有数据
+ (BOOL)deleteAllDataWithGroupType:(CurrenChatObjType)groupType database:(FMDatabase *)db;

//根据gruoupName查询群或讨论组信息
+ (NSArray *)queryContactGroupByGroupName:(NSString *)groupName database:(FMDatabase *)db;

//查询全部群或讨论组信息
+ (NSArray *)queryContactGroupWithGroupType:(CurrenChatObjType)groupType database:(FMDatabase *)db;

//根据gruoupName更新群或讨论组信息
- (BOOL)updateGroupDatabase:(FMDatabase *)db;

// 判断群组/讨论组是否存在
- (BOOL)isContactGroupExistInDatabase:(FMDatabase *)db;

//根据关键字查询Group
+ (NSArray *)queryGroupByKeywords:(NSString *)keyWords groupType:(CurrenChatObjType)groupType database:(FMDatabase *)db;


@end
